package com.cheerscpl.handler;

import com.cheerscpl.DataHelper;
import com.cheerscpl.annotation.EventHandler;
import com.cheerscpl.protocol.model.DataPacket;
import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;

/**
 * Created by chenpuliang on 2017/6/4.
 */
@EventHandler
public class DataPacketHanler {


    @Subscribe
    @AllowConcurrentEvents
    public void subscribe(DataPacket dataPacket){
        if(null != dataPacket){
            //TODO 处理业务逻辑
            if(dataPacket.getFid().equals("F2") && dataPacket.getMsgId().equals("B0")){
                System.out.println("==========> 终端: " + dataPacket.getDevId() +  " 签到成功");
                //TODO 验证发送通道
                DataHelper.send(dataPacket);
            }
        }
    }

}
